package com.wtp.wallpaper.rabbitmq.producer;

import com.wtp.wallpaper.rabbitmq.data.DataChangeEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class PictureProducer {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendPictureMessage(DataChangeEvent event) {
        log.info("发送消息：{}", event);
        rabbitTemplate.convertAndSend("es.sync.queue", event);
    }
}
